import React from "react";
import ReactDOM from "react-dom/client";
import { BrowserRouter } from "react-router-dom";
import App from "./App";

import "./assets/fonts/iconfont.css";
import "./index.css";
import "./styles/base.less";

// rem
import "lib-flexible";

// 处理最大宽度
(function () {
  const handleMax = function handleMax() {
    let html = document.documentElement;
    let root = document.getElementById("root");
    let size = parseFloat(html.style.fontSize);
    root.style.maxWidth = "750px";
    if (size >= 37.5) {
      root.style.fontSize = "37.5px";
    }
  };

  handleMax();

  window.addEventListener("resize", handleMax);
})();

window._AMapSecurityConfig = {
  securityJsCode: "69779895b1a6d1ac88a2fef83fc98b5c",
};

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
  // <React.StrictMode></React.StrictMode>
  <BrowserRouter>
    <App />
  </BrowserRouter>
);
